using System;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;
using Microsoft.Web.Mvc;

namespace BabyShop.Site.Models
{
    [Table("Users")]
    public class User
    {

        [Key]
        public Guid UserGuid { get; set; }

        [Required]
        [StringLength(16,MinimumLength = 4)]
        public string Account { get; set; }

        [Required]
        [DataType(DataType.EmailAddress)]
        [EmailAddress]
        public string Email { get; set; }

        [Required]
        [StringLength(200,MinimumLength = 10)]
        public string HashPass { get; set; }

        [Required]
        [MaxLength(8)]
        public string PassKey { get; set; }

        [MaxLength(16)]
        public string NickName { get; set; }

        public Guid? ParentGuid { get; set; }

        public CommonColumns CommonColumns { get; set; }

        [ForeignKey("ParentGuid")]
        public User ParentUser { get; set; }

        public ICollection<User> ChildUsers { get; set; }
    }
}